﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace You.Niao.Pic
{
    public class PicAreaRegistration : AreaRegistration
    {
        public override string AreaName
        {
            get
            {
                return "Pic";
            }
        }
         public override void RegisterArea(AreaRegistrationContext context)
        {
            foreach (var route in GetRoutes())
                context.Routes.Add(route);
        }

         public IEnumerable<Route> GetRoutes()
         {
             return new[] { 
               
                new Route(   //默认
                    "UserAPI/{action}/{id}",
                    new RouteValueDictionary { { "area", AreaName }, { "controller", "UserAPI" }, { "action", "Index" },{"id",""} },
                    new RouteValueDictionary(),
                    new RouteValueDictionary { { "area", AreaName }},
                    new MvcRouteHandler()
                )  


            };
         }
    }
}
